package org.domain.modeller;

// Generated Mar 18, 2009 2:57:10 PM by Hibernate Tools 3.2.2.GA

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Priority generated by hbm2java
 */
@Entity
@Table(name = "priority", catalog = "modeller")
public class Priority implements java.io.Serializable {

	private Long id;
	private String description;
	private String name;
	private short value;
	private Set<Task> tasks = new HashSet<Task>(0);

	public Priority() {
	}

	public Priority(String description, String name, short value) {
		this.description = description;
		this.name = name;
		this.value = value;
	}

	public Priority(String description, String name, short value,
			Set<Task> tasks) {
		this.description = description;
		this.name = name;
		this.value = value;
		this.tasks = tasks;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "description", nullable = false)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "name", nullable = false, length = 10)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "value", nullable = false)
	public short getValue() {
		return this.value;
	}

	public void setValue(short value) {
		this.value = value;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "priority")
	public Set<Task> getTasks() {
		return this.tasks;
	}

	public void setTasks(Set<Task> tasks) {
		this.tasks = tasks;
	}

}
